<div class="well">
  <form name="createForm" class="form-horizontal" role="form"
        ng-init="send('organ.index', {}); send('position.index', {});"
        ng-submit="create_command();">

    <div class="form-group">
      <label class="col-sm-2 control-label required">机构类型名称</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" ng-model="rating_new.name" required>
      </div>
    </div>

    <hr>
    <div class="form-group">
      <label class="col-sm-2 control-label required">归类部门清单</label>
      <div class="col-lg-10">
        <div ng-switch on="selected_organ_index.length">
          <span class="text-warning" ng-switch-when="0">暂无，请至少选择一个部门！</span>
          <ul ng-switch-default><li ng-repeat="t in selected_organ_index">
              <span>{{t.name}}</span>
              <span>
                <a href ng-click="rating_new.groups = remove_organ(rating_new.groups, t);">
                  <i class="fa fa-remove fa-1x text-warning"></i>
                </a>
              </span>
          </li></ul>
        </div>
      </div>
    </div>

    <div class="form-group">
      <div class="col-lg-offset-2 col-lg-2">
        <p class="form-control-static">增加部门:</p>
      </div>
      <div class="col-lg-6">
        <select class="form-control" ng-model="group_new" ng-options="m.dn as m.name for m in avail_organ_index">
          <option value="">-- 请选择 --</option>
        </select>
      </div>
      <div class="col-lg-2">
        <p class="form-control-static" ng-show="group_new.length > 0">
          <a href ng-click="rating_new.groups = add_organ(rating_new.groups, group_new); group_new = '';">
            <i class="fa fa-check fa-1x"></i>
          </a>
        </p>
      </div>
    </div>
    <hr>


    <div class="form-group">
      <label class="col-sm-2 control-label required">岗位设置清单</label>
      <div class="col-lg-10">
        <div ng-switch on="selected_position_index.length">
          <span class="text-warning" ng-switch-when="0">暂无，请至少选择一个岗位！</span>
          <ul ng-switch-default><li ng-repeat="t in selected_position_index">
              <span>{{t.name}}</span>
              <span>
                <a href ng-click="rating_new.positions = remove_position(rating_new.positions, t);">
                  <i class="fa fa-remove fa-1x text-warning"></i>
                </a>
              </span>
          </li></ul>
        </div>
      </div>
    </div>

    <div class="form-group">
      <div class="col-lg-offset-2 col-lg-2">
        <p class="form-control-static">增加部门:</p>
      </div>
      <div class="col-lg-6">
        <select class="form-control" ng-model="position_new" ng-options="m.dn as m.name for m in avail_position_index">
          <option value="">-- 请选择 --</option>
        </select>
      </div>
      <div class="col-lg-2">
        <p class="form-control-static" ng-show="position_new.length > 0">
          <a href ng-click="rating_new.positions = add_position(rating_new.positions, position_new); position_new = '';">
            <i class="fa fa-check fa-1x"></i>
          </a>
        </p>
      </div>
    </div>
    <hr>



    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <input class="btn btn-primary" type="submit" ng-disabled="createForm.$invalid || ((selected_position_index.length == 0) && (selected_organ_index.length == 0))">
        或者
        <a ui-sref="setting.organ.rating">取消</a>
      </div>
    </div>
  </form>
</div>

<hr>
